% sentence(Parse,[d9i5a, chi3, cu3a, cu73a, ha2ng, ba1n, tu3, la5nh, sharp, SJ16VSL, o73, d9a6u],[]).
% d9i5a chi3 (cu3a) (cu73a ha2ng) ba1n tu3 la5nh/ ma1y la5nh/ tu3 d9o6ng sharp/samsung/lg xxx/yyy o73 d9a6u

sentence(s(NP, VP))-->np(NP),vp(VP).

% cum danh tu
np(np(N_tuhoi, E, C_CH))-->n_tuhoi(N_tuhoi), e(E), c(C_CH).

% cac tu hoi
n_tuhoi(n_tuhoi('d9i5a chi3'))-->[d9i5a, chi3].

% gioi tu
e(e(cu3a))-->[cu3a];[].

% danh tu cua hang
c(c('cu73a ha2ng'))-->[cu73a, ha2ng];[].

% cum dong tu
vp(vp(V, SP, R))-->v(V), sp(SP), r(R).

% dong tu
v(v(ba1n))-->[ba1n].

% san pham
sp(sp(N_sp, N))-->n_sp(N_sp), n(N).

% cac loai san pham
n_sp(n_sp('tu3 la5nh'))-->[tu3, la5nh].
n_sp(n_sp('tu3 d9o6ng'))-->[tu3, d9o6ng].
n_sp(n_sp('tu3 ma1t'))-->[tu3, ma1t].
n_sp(n_sp('ma1y la5nh'))-->[ma1y, la5nh].
n_sp(n_sp('ma1y gia85t'))-->[ma1y, gia85t].
n_sp(n_sp('d9ie62u ho2a'))-->[d9ie62u, ho2a].

n(n(N_hsx, Pron_sp))-->n_hsx(N_hsx),!,pron_sp(Pron_sp).
n(Pron_sp)-->pron_sp(Pron_sp).

% cac hang san xuat
n_hsx(n_hsx(panasonic))-->[panasonic].
n_hsx(n_hsx(daikin))-->[daikin].
n_hsx(n_hsx(lg))-->[lg].
n_hsx(n_hsx(samsung))-->[samsung].
n_hsx(n_hsx(mitsubishi))-->[mitsubishi].
n_hsx(n_hsx(electrolux))-->[electrolux].
n_hsx(n_hsx(sharp))-->[sharp].
n_hsx(n_hsx(sanyo))-->[sanyo].
n_hsx(n_hsx(hitachi))-->[hitachi].
n_hsx(n_hsx(gree))-->[gree].

pron_sp(pron_sp(H))-->[H].

% Phu tu
r(r(W_nam, W_odau))-->w_nam(W_nam),w_odau(W_odau).
r(r(W_nam))-->w_nam(W_nam).
r(r(W_odau))-->w_odau(W_odau).

w_nam(na82m)-->[na82m];[].
w_odau('o73 d9a6u')-->[o73, d9a6u];[].